<template>
	<div class="wrap">
		<div class="table-box">
			<el-table :data="data" stripe :header-cell-style="header_cell_style" :max-height="table_max_height">
				<el-table-column prop="id" label="ID"></el-table-column>
				<el-table-column prop="face_id" label="face_id"></el-table-column>
				<el-table-column prop="group" label="人脸组"></el-table-column>
				<el-table-column prop="type" label="类型"></el-table-column>
				<el-table-column prop="room_address" label="房间地址"></el-table-column>
			</el-table>
		</div>
		<page-component @pageChanged="onPageChanged"></page-component>
	</div>
</template>

<script>
	import API from '@/api/index.js'
	import mixin from '@/mixin.js';

	export default {
		mixins: [mixin],
		data() {
			return {
				face_id: ''
			}
		},
		created() {
			this.face_id = localStorage.getItem('face_id');
			this.getData();
		},
		methods: {
			async getData() {
				let self = this;
				self.loading = true;
				try {
					let params = {
						face_id: self.face_id ? self.face_id : ''
					}
					self.addPageInfo(params)
					let res = await API.multiFaces(params.pageNumber, params.pageSize, params.face_id)
					self.loading = false;
					self.onGotPageData(res)
				} catch (err) {
					self.loading = false;
				}
			},
		}
	}
</script>

<style>
</style>
